public class FizzBuzz {
    private int num;
    public FizzBuzz(int num){
        if (num < 1 || num > 100) {
            throw new IllegalArgumentException("无效输入");
        }
        this.num=num;
    }
    public String fizzBuzz() {

        if (num % 3 == 0 && num % 5 == 0) {
            return "FizzBuzz";
        }

        if (num % 3 == 0) {
            return "Fizz";
        }

        if (String.valueOf(num).contains("3") && String.valueOf(num).contains("5")) {
            return "FizzBuzz";
        }
        if (num % 5 == 0) {
            return "Buzz";
        }

        if (String.valueOf(num).contains("3")) {
            return "Fizz";
        }

        if (String.valueOf(num).contains("5")) {
            return "Buzz";
        }

        return String.valueOf(num);
    }
}
